package com.yeban.javase.day13.learn;

import java.io.*;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/10/23
 *
 * FileReader   字符流     输入流
 */
public class FileReaderDemo {

    public static void main(String[] args) {
        // 读
        try(
            FileReader fr = new FileReader("D:\\Code\\geek_learn\\JavaSE\\src\\com\\yeban\\javase\\day13\\demo\\aaa\\demo.txt");
        ) {
            // 做个桶
            char[] chars = new char[1024];
            // 记录长度，偏移量
            int len = 0;
            while((len = fr.read(chars)) != -1) {
                String str = new String(chars, 0, len);
                System.out.println(str);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }


}
